package com.admin.education.models;

import com.admin.education.repositories.Identifiable;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

@Entity
@Table(name = "integrals")
@EntityListeners(AuditingEntityListener.class)
@Data
public class Integrals  implements Serializable,Identifiable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    @OneToOne
    @JSONField(serialize=false)
    private UserInformation userInformation;
    @Column(name="value")
    @NotNull
    private BigDecimal value;
    @Column(name="designation")
    public String designation;
}
